public class TwoSumII {
    public int[] twoSum(int[] numbers, int target) {
        int left =0;
        int right = numbers.length-1;
        while (right!=left){
            if (numbers[right]+numbers[left]==target){
                return new int[]{left,right};
            }
            else if (numbers[right]+numbers[left]>target){
                right--;
            }
            else {
                left++;
            }

        }
        return null;

    }
}
